﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Twi.COMMON.WPF
{
    /// <summary>
    /// Interaction logic for InputReamark.xaml
    /// </summary>
    public partial class InputRemark : Window
    {
        bool isNeed = true;

        /// <summary>
        /// 默认是可填，可不填
        /// </summary>
        public InputRemark(bool _isNeed = true)
        {
            InitializeComponent();
            isNeed = _isNeed;
            TxtReamark.Focus();
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (isNeed)  //判断原因是否必输
            {
                if (TxtReamark.Text.Trim() == "")
                {
                    MessageBox.Show("请输入备注！", "系统提示");
                    return;
                }
            }
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            
        }
    }
}
